package com.ustudy.entity.sns;

import java.util.Collections;
import java.util.List;

import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;

import org.ustudy.core.dao.support.entity.LongIdEntity;

/**
 * 论坛版块
 * @author caizh
 *
 */
@SuppressWarnings("serial")
@Entity(name="ForumSection")
@Table(name="SNS_FORUM_SECTION")
public class ForumSection extends LongIdEntity {
	
	private String name;
	
	private String memo;
	
	@ManyToOne(cascade={CascadeType.REFRESH},fetch=FetchType.LAZY)
	@JoinColumn(name="FC_ID")
	private ForumClassification forumClassification;
	
	private Long createTime=System.currentTimeMillis();

	@OneToMany(cascade={CascadeType.REMOVE},fetch=FetchType.LAZY,mappedBy="forumSection")
	private List<ForumSectionAdmin> admins=Collections.emptyList();
	
	@OneToMany(cascade={CascadeType.REMOVE},fetch=FetchType.LAZY,mappedBy="forumSection")
	private List<Topic> topics=Collections.emptyList();
	
	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getMemo() {
		return memo;
	}

	public void setMemo(String memo) {
		this.memo = memo;
	}

	public ForumClassification getForumClassification() {
		return forumClassification;
	}

	public void setForumClassification(ForumClassification forumClassification) {
		this.forumClassification = forumClassification;
	}

	public Long getCreateTime() {
		return createTime;
	}

	public void setCreateTime(Long createTime) {
		this.createTime = createTime;
	}

	public List<ForumSectionAdmin> getAdmins() {
		return admins;
	}

	public void setAdmins(List<ForumSectionAdmin> admins) {
		this.admins = admins;
	}

	public List<Topic> getTopics() {
		return topics;
	}

	public void setTopics(List<Topic> topics) {
		this.topics = topics;
	}
	
	
}
